Z Score (Close + High and Low bands)Basic z score with High and Low bands.
If z is positive = uptrend.
If z is negative = downtrend.
If z > +3 or z < -3 = reverse is possible.
H lines can act as a support/resistance.
Disclaimer:
Trading success is all about following your trading strategy and the indicators should fit within your trading strategy, and not to be traded upon solely
The script is for informational and educational purposes only. Use of the script does not constitute professional and/or financial advice. You alone have the sole responsibility of evaluating the script output and risks associated with the use of the script. In exchange for using the script, you agree not to hold dgtrd TradingView user liable for any possible claim for damages arising from any decision you make based on use of the script
חפש סקריפטים עבור "THE SCRIPT"
The Strat Numbers & CombosThis indicator is an all-in-one " The Strat " script. This script displays the following:
The Strat candle numbers (1's, 2's, & 3's)
The Strat Combo labels along with trigger line
Pivot Machine Gun ( PMG ) dynamic labels
Hammer & Shooter candle labels
The Strat Candle Numbers label each candle, on any timeframe, either a 1, 2, or 3. 1's are inside bars of the previous candles. 2's take out only one side of the previous candle. And 3's go outside both sides of the previous candle.
The Strat Combo labels (which are made of the 1's, 2's, 3's outlined above) display labels when a Strat Combo occurs. The script displays a label, direction arrow, and trigger line for each Strat Combo. This indicator finds the following Strat Combos:
2-1-2 bullish reversal (BLR)
2-1-2 bullish continuation (BLC)
3-1-2 BLR
3-2-2 BLR
1-2-2 rev strat BLR
2-2 BLR
2-1-2 bearish reversal (BRR)
2-1-2 bearish continuation (BRC)
3-1-2 BRR
3-2-2 BRR
1-2-2 rev strat BRR
2-2 BRR
Double inside candles
The Pivot Machine Gun (PMG) labels any 5 or more consecutive candles that make higher lows or 5 or more consecutive candles that make lower highs. A PMG can continue going in its direction or it can reverse and come back through the range. The logic in this indicator dynamically finds each level in a PMG and draws a line for easy identification.
The script also identifies if the candle type is a Hammer, Inverted Hammer, Shooting Star, or Hanging Man. These candle types are highly likely reversal points in price action.The indicator will plot a shape with a color coded icon identifying the candle. The distance between the shape and the candles can be manually adjusted in the inputs section.
This indicator has many style options . The user can independently toggle on/off the Strat numbers, boxes around the Strat Combos, and Hammer and Shooter shapes. Also all of the colors used in this script can be changed from the inputs section, so a user can easily change colors to match their current color scheme.
Swing Trades Validator - The One TraderThis swing trading strategy validator is built on the original strategy taught in my bootcamp for swing traders.
The strategy is simple and follows a trend trading pattern on prices reacting to Exponential Moving Averages over a multiple time-frame analysis.
The details of the strategy are as follows:
- Holding Period : Upto a couple of months
- Time-frames to be analysed : Month - Week - Day
- Trade Execution : Daily Time-frame
Analysis Details:
Step 1 : On the Monthly time-frame, the candle needs to be bullish with the latest close being higher than the opening price of the month.
Step 2 : The price needs to be above the 8ema on the Monthly time-frame.
Step 3 : The 8ema must be above the 20ema on the Monthly time-frame.
The above steps indicate a bullish strength in the instrument on the Monthly time-frame.
Step 4 : On the Weekly time-frame, the candle needs to be bullish with the latest close being higher than the opening price of the week.
Step 5 : The price needs to be above the 8ema on the Weekly time-frame.
Step 6 : The 8ema must be above the 20ema on the Weekly time-frame.
The above steps indicate a bullish strength in the instrument on the Weekly time-frame.
Step 7 : On the Daily time-frame, the candle needs to be bullish with the latest close being higher than the opening price of the day.
Step 8 : The price needs to be above the 8ema on the Daily time-frame.
Step 9 : The 8ema must be above the 20ema on the Daily time-frame.
The above steps indicate a bullish strength in the instrument on the Daily time-frame.
Step 10 : While the 8ema is above the 20ema on the Daily time-frame, the price must be allowed to rise before a pullback is seen towards the moving averages, indicating a bearish move trying to change the trend.
Step 11 : These pullback candles need to form a pattern called the Ring Low with the second pullback candle having a lower high and lower low and the low of the last pullback candle being lesser than or equal to the fat ema on the Daily time-frame.
Step 12 : If the stock is still bullish and the trend is displaying a strength in the underlying bullish direction, then there will be a resumption candle that will have a closing price higher than the previous day's high price.
This trend continuation signal is a confirmation that the instrument will continue in the underlying trend direction and we will be able to enter if this condition is satisfied.
The profit and loss percentages are set at a default 10% as this can be a minimum risk : reward for swing trades on average, but the inputs have been made available to the users in order to adjust the risk : reward to find the most optimum breathing room for each individual stock or instrument. This will give the user a highly custom overview of the strategy on individual instruments based on their volatility and price movements.
The strategy tester will auto back-test this strategy historically and find all the trades that were taken based on this strategy and populate a performance summary.
The most important data in V1.0 of this script are as follows:
1. No. of Trades Taken : We want to see many trades being taken on this strategy in that particular instrument. This shows us a healthy report on the number of winning vs. losing trades.
2. Percentage Profitable : We want to see that this strategy has worked out in the past and is giving us a high probability of return. This in no way an indication that the strategy will definitely work out in the future as well, but gives us an idea of whether or not we should enter this trade.
3. No. of Winning Trades vs. Losing Trades : We would like to see a significantly higher number of winning trades.
4. Avg. # of bars in a trade : This gives us an idea of how long on average we might have to wait to see the results of this strategy either in favor of our reward or against our desired direction. Some trades can be completed in around 15-20 bars on average and some trades have shown to take upto 45 days to reach desired reward. This is in line with our planned holding period, but gives the trader a sense of time and increased level of patience.
The future updates will have more utility of the various elements of the strategy tester and the entire exit strategy will be integrated into the script.
This script is not to be used as a standalone method and must be studied well in order to execute trades. I have not hidden visibility on other time-frames, but since order execution is done on the Daily time-frame, the script must run on the Daily time-frame only.
There are many other factors to be taken into consideration before entering a trade and proper risk management and position sizing rules must be followed.
Our bootcamp participants will use this strategy tester in conjunction with the invite-only Trading Toolkit assigned to them.
The development of this script will be ongoing and all comments and feedback are welcome.
Argo I (alerts for 3commas single bots)This script lets users create BUY/SELL alerts for 3commas single bots in a simple way, based on a built in set of indicators that can be tweaked to work together or separately through the study settings. Indicators include Bollinger Bands, Williams %R, RSI, EMA, SMA , Market Cipher, Inverse Fisher Transform.
If the user choses to create both BUY and SELL signals from the study settings, the alert created will send both BUY and SELL signals for the selected pair. Note the script will only send alerts for the pair selected in the study settings, not for the current chart (if different).
How to use:
- Add the script to the current chart
- Open the study settings , insert bot details. Pairs MUST be in capital letters or 3commas will not recognize them.
- Still in the study settings, tweak the deal start/close conditions from various indicators until happy. The study will plot the entry / exit points below the current chart (1 = buy, 2 = sell)
- Ideally, test the settings with a backtesting script. The present script is compatible with the Trading Parrot's backtester.
- When happy, right click on the "..." next to the study name, then "Add alert'".
- Under "Condition", on the second line, chose "Any alert () function call". Add the webhook from 3commas, give it a name, and "create".
Happy tweaking!
QFL base scannerThis script is a simple implementation of a QFL (Quickfingers Luc) base scanner.
This QFL base scanner uses a different approach to some other QFL base scanners that are on TradingView. Other TradingView scripts look for a candlestick pattern of two lower lows followed by two higher lows combined with an increase in volume. This can generate some unexpected results where some minor dips can meet the pattern and are marked as a base, but some major dips do not and are ignored.
This QFL base scanner instead looks for the lowest low in a given period and marks it as a base. The longer the period of the lowest low, the more significant the bases will be. Buys are marked when the price has bounced x% above the base and then fallen y% below the base. This approach seems to give more predictable (and tradable) results.
If looking at the past script results, you may think that the script is perfectly timing entry points at the bottom of market dips. This is NOT the case. The script is actually showing buy signals when the price falls y% below the PREVIOUS base. The current base is only retrospectively marked some periods later once the reversal is confirmed. New bases are not tradeable using this script, but a percentage fall from the previous base is.
Enjoy.
Cup FinderHello All,
This script finds the Cups and you can use it while analysing the symbols. it creates circle and channel for the potential Cups and checks the number of bars included by the channel, if included bars is equal or greater than the value you set then it shows the cup.
The Options:
"Number for Bars to search" : Maximum length of a Cup
"Channel Width of the Cup" : Tate by the channel width of highest/lowest levels in last 300 bars, by default it's 5%
"Check for Breakout" : if there is Cup then it checks Close or High/Low is used a source for breaokuts, usuful while cheking historical bars
"Contained Bar Rate %" : after channel is created the script checks number of bars included by the channel of the Cup, you can set rate of included bars by this option
"S how Channels of Cups ": if you enable this option then you can see the channels around the Cups and set it as you wish
and there are some other options for labeling/removing old Cups and for coloring
Here you can see how channel looks like:
Cup with different colors:
P.S. This is an experimental work and sorry for no explanation in the script.
in the future if I have time I will try to write a script for Cup&Handle
This script is also an example to calculate and draw circles :)
Enjoy!
WatermarkLook in the lower-left corner of this chart. If you load the script on your chart, you will see how the watermark animates. You can personalize it in the script's "Settings/Inputs" tab to use it in your chart snapshots.
Do keep in mind that if you use it when publishing ideas, videos or scripts, House Rules prohibit advertising on your chart.
For Pine coders
This script uses our new table feature in Pine to position a watermark on the chart, and the new varip type of variable to animate it.
Look first. Then leap.
Quantumvest - Auto LevelsAuthor: Arthur Wayne
Description: This script automatically plots levels according to Primetime Trading Academy guidelines.
Directions:
On the monthly chart, you should select two significant monthly support/resistance levels and input them into the script. It is recommended to mark these levels with the price label tool.
The script will then automatically plot 2 monthly 'wings' or additional monthly support/resistance levels above and below the original monthly high and low that are the same distance apart. Located half way in between the monthly levels, there will be weekly support/resistance levels. None of the values will go below 0. These levels should then be used on lower time-frames for technical analysis.
There is the option to customize the number of monthly wings, the width of the box surrounds the monthly s/r levels, the x-position of the level labels, as well as the colors for everything.
The biggest drawback is that levels will not save in between charts. This is a limitation of Pine Script and how TradingView does not offer the ability to create custom drawing tools, only indicators and strategies. This is why it is recommended to use the price label tool to keep track in between charts for different assets. Regardless, this script should make the process of drawing levels manually far more efficient than it was before.
Join data and union of 2 hystorical markets
How to create a union from two contiguous Tradingview tickers (series)
Francesco Marzolo March 18, 2021
Go to the older ticker of the two, for example CME: SP1! and open it on Tradingview.
On the graph thus created, add this script.
In the indicator settings select the same ticker as the chart in Symbol1
while in Symbol2 the ticker from which to retrieve the most recent data, for example: SPX500
The operation this script does is examine each bar of the two tickers, where there is a value for the second it holds this one, where it does not exist in second ticker it keeps the value of the first one. This new series is called Merge. So now in the chart there will be 4 series:
- that of the original chart without script
- the same series loaded via script (Symbol1)
- series 2 of "new" data (Symbol2)
- the Merge series that "prefers" the Symbol2 data if present, otherwise it shows Symbol1
So now you have to change the visibility of the 4 series to see the differences:
- turn off the visibility of the chart indicator
- turn off the Symbol1 series in the script properties (old data only)
- switch off the Symbol2 series as well (only new data)
- switch on the Merge series (new data if existing, old if not present in the new ticker)
Double EMA CROSS
Double EMA CROSS (DEC)
Useful for identifying and receiving alerts about uptrends and downtrends.
This script uses two Exponential Moving Averages (EMAs) to find price uptrends and downtrends.
An Exponential Moving Average ( EMA ) is a type of moving average that places a greater weight and significance on the most recent data points.
The script produces uptrend and downtrend signals based on crossovers and divergences between the two EMAs,
the user will be able to spot a trend change (when the EMAs crossover) and to determine the strength of the current trend (when the EMAs diverge).
It is also posible to get alerts for uptrends and downtrends on the web and mobile app with sound and pop-ups as well as via email.
The optimal time to enter and exit the market can be concluded from this trend changes.
The user can set their own EMAs, by default they are set to 25 and 75 periods for medium and long term respectively.
When the medium term EMA crosses below the long term EMA the asset is in a downtrend and the price will decline, and when the
medium term EMA crosses above the long term EMA the asset is in an uptrend and price will increase.
This scripts plots the following indicators and signals on the chart to help the user to identify trends:
1.- Medium and long term EMAs as lines overlaid on the price chart.
2.- Up green triangles above bars when the price is on an uptrend and down red triangles below bars when the price is on a downtrend.
3.- Arrows with text to indicate the start of an uptrend or downtrend.
The user can enable and disable the indicators and signals as well as set colors and shapes to their liking.
This script also lets the user create alerts for uptrends and downtrends. To create a new alert using this script follow this instructions:
1.- Once you added this script to your chart, go to the alerts panel (right on web or bottom tool bar on the mobile app) and add a new alert (alarm clock icon with a plus sign).
2.- A modal window will open. On the “Condition” dropdown menu select “DEC”.
3.- On the next dropdown menu (right below the “Condition” one) you can select.
4.- Lastly you can set all the normal alert options and create the alert.
EMA CrossoversUseful for identifying and receiving alerts about uptrends and downtrends.
This script uses two Exponential Moving Averages (EMAs) to find price uptrends and downtrends. An Exponential Moving Average (EMA) is a type of moving average that places a greater weight and significance on the most recent data points. The script produces uptrend and downtrend signals based on crossovers and divergences between the two EMAs, the user will be able to spot a trend change (when the EMAs crossover) and to determine the strength of the current trend (when the EMAs diverge). It is also posible to get alerts for uptrends and downtrends on the web and mobile app with sound and pop-ups as well as via email. The optimal time to enter and exit the market can be concluded from this trend changes.
The user can set their own EMAs, by default they are set to 21 and 55 periods for medium and long term respectively. When the medium term EMA crosses below the long term EMA the asset is in a downtrend and the price will decline, and when the medium term EMA crosses above the long term EMA the asset is in an uptrend and price will increase.
This scripts plots the following indicators and signals on the chart to help the user to identify trends:
1.- Medium and long term EMAs as lines overlaid on the price chart.
2.- Up green triangles above bars when the price is on an uptrend and down red triangles below bars when the price is on a downtrend.
3.- Arrows with text to indicate the start of an uptrend or downtrend.
The user can enable and disable the indicators and signals as well as set colors and shapes to their liking.
This script also lets the user create alerts for uptrends and downtrends. To create a new alert using this script follow this instructions:
1.- Once you added this script to your chart, go to the alerts panel (right on web or bottom tool bar on the mobile app) and add a new alert (alarm clock icon with a plus sign).
2.- A modal window will open. On the “Condition” dropdown menu select “EMA Crossovers”.
3.- On the next dropdown menu (right below the “Condition” one) you can select from two types of alerts “Uptrend started” and “Downtrend started”.
4.- Lastly you can set all the normal alert options and create the alert.
Efficient Work [LucF]█ OVERVIEW
Efficient Work measures the ratio of price movement from close to close ( resulting work ) over the distance traveled to the high and low before settling down at the close ( total work ). The closer the two values are, the more Efficient Work approaches its maximum value of +1 for an up move or -1 for a down move. When price does not change, Efficient Work is zero.
Higher values of Efficient Work indicate more efficient price travel between the close of two successive bars, which I interpret to be more significant, regardless of the move's amplitude. Because it measures the direction and strength of price changes rather than their amplitude, Efficient Work may be thought of as a sentiment indicator.
█ CONCEPTS
This oscillator's design stems from a few key concepts.
Relative Levels
Other than the centerline, relative rather than absolute levels are used to identify levels of interest. Accordingly, no fixed levels correspond to overbought/oversold conditions. Relative levels of interest are identified using:
• A Donchian channel (historical highs/lows).
• The oscillator's position relative to higher timeframe values.
• Oscillator levels following points in time where a divergence is identified.
Higher timeframes
Two progressively higher timeframes are used to calculate larger-context values for the oscillator. The rationale underlying the use of timeframes higher than the chart's is that, while they change less frequently than the values calculated at the chart's resolution, they are more meaningful because more work (trader activity) is required to calculate them. Combining the immediacy of values calculated at the chart's resolution to higher timeframe values achieves a compromise between responsiveness and reliability.
Divergences as points of interest rather than directional clues
A very simple interpretation of what constitutes a divergence is used. A divergence is defined as a discrepancy between any bar's direction and the direction of the signal line on that same bar. No attempt is made to attribute a directional bias to divergences when they occur. Instead, the oscillator's level is saved and subsequent movement of the oscillator relative to the saved level is what determines the bullish/bearish state of the oscillator.
Conservative coloring scheme
Several additive coloring conditions allow the bull/bear coloring of the oscillator's main line to be restricted to specific areas meeting all the selected conditions. The concept is built on the premise that most of the time, an oscillator's value should be viewed as mere noise, and that somewhat like price, it only occasionally conveys actionable information.
█ FEATURES
Plots
• Three lines can be plotted. They are named Main line , Line 2 and Line 3 . You decide which calculation to use for each line:
• The oscillator's value at the chart's resolution.
• The oscillator's value at a medium timeframe higher than the chart's resolution.
• The oscillator's value at the highest timeframe.
• An aggregate line calculated using a weighed average of the three previous lines (see the Aggregate Weights section of Inputs to configure the weights).
• The coloring conditions, divergence levels and the Hi/Lo channel always apply to the Main line, whichever calculation you decide to use for it.
• The color of lines 2 and 3 are fixed but can be set in the "Colors" section of Inputs.
• You can change the thickness of each line.
• When the aggregate line is displayed, higher timeframe values are only used in its calculation when they become available in the chart's history,
otherwise the aggregate line would appear much later on the chart. To indicate when each higher timeframe value becomes available,
a small label appears near the centerline.
• Divergences can be shown as small dots on the centerline.
• Divergence levels can be shown. The level and fill are determined by the oscillator's position relative to the last saved divergence level.
• Bull/bear markers can be displayed. They occur whenever a new bull/bear state is determined by the "Main Line Coloring Conditions".
• The Hi/Lo (Donchian) channel can be displayed, and its period defined.
• The background can display the state of any one of 11 different conditions.
• The resolutions used for the higher timeframes can be displayed to the right of the last bar's value.
• Four key values are always displayed in the Data Window (fourth icon down to the right of your chart):
oscillator values for the chart, medium and highest timeframes, and the oscillator's instant value before it is averaged.
Main Line Coloring Conditions
• Nine different conditions can be selected to determine the bull/bear coloring of the main line. All conditions set to "ON" must be met to determine the bull/bear state.
• A volatility state can also be used to filter the conditions.
• When the coloring conditions and the filter do not allow for a bull/bear state to be determined, the neutral color is used.
Signal
• Seven different averages can be used to calculate the average of the oscillator's value.
• The average's period can be set. A period of one will show the instant value of the oscillator,
provided you don't use linear regression or the Hull MA as they do not work with a period of one.
• An external signal can be used as the oscillator's instant value. If an already averaged external value is used, set the period to one in this indicator.
• For the cases where an external signal is used, a centerline value can be set.
Higher Timeframes
• The two higher timeframes are named Medium timeframe and Highest timeframe . They can be determined using one of three methods:
• Auto-steps: the higher timeframes are determined using the chart's resolution. If the chart uses a seconds resolution, for example,
the medium and highest resolutions will be 15 and 60 minutes.
• Multiples: the timeframes are calculated using a multiple of the chart's resolution, which you can set.
• Fixed: the set timeframes do not change with the chart's resolution.
Repainting
• Repainting can be controlled separately for the chart's value and the higher timeframe values.
• The default is a repainting chart value and non-repainting higher timeframe values. The Aggregate line will thus repaint by default,
as it uses the chart's value along with the higher timeframes values.
Aggregate Weights
• The weight of each component of the Aggregate line can be set.
• The default is equal weights for the three components, meaning that the chart's value accounts for one third of the weight in the Aggregate.
High Volatility
• This provides control over the volatility filter used in the Main line's coloring conditions and the background display.
• Volatility is determined to be high when the short-term ATR is greater than the long-term ATR.
Colors
• You can define your own colors for all of the oscillator's plots.
• The default colors will perform well on both white and black chart backgrounds.
Alerts
• An alert can be defined for the script. The alert will trigger whenever a bull/bear marker appears in the indicator's display.
The particular combination of coloring conditions and the display of bull/bear markers when you create the alert will thus determine when the alert triggers.
Once the alerts are created, subsequent changes to the conditions controlling the display of markers will not affect the existing alert(s).
• You can create multiple alerts from this script, each triggering on different conditions.
Backtesting & Trading Engine Signal Line
• An invisible plot named "BTE Signal" is provided. It can be used as an entry signal when connected to the PineCoders Backtesting & Trading Engine as an external input.
It will generate an entry whenever a marker is displayed.
█ NOTES
• I do not know for sure if the calculations in Efficient Work are original. I apologize if they are not.
• Because this version of Efficient Work only has access to OHLC information, it cannot measure the total distance traveled through all of a bar's ticks, but the indicator nonetheless behaves in a manner consistent with the intentions underlying its design.
For Pine coders
This code was written using the following standards:
• The PineCoders Coding Conventions for Pine .
• A modified version of the PineCoders MTF Oscillator Framework and MTF Selection Framework .
Slippage Calculator Hello everyone,
This is the first script I publish, also my English is not the best my apologies.
This simple study script is an attempt to estimate the slippage during a trade. By no means it is a precise calculation, it is just an approach that can be improved.
You are welcome to take this simple script and use it and change it at your convenience just ask your acknowledge.
My approach considers the total fluctuation the price gets as a consequence for the total volume on that specific bar.
The volume on each bar is given in BTC, thus you get that by using the formula.
vol = volume * vwap
The total variation in price is considered as twice the size of the bar plus the gap between to consecutive bars. that is the
total fluctuation of price on each bar = (2 * (high - low) + abs(open - close )) which is not totally true since inside each bar price can fluctuate a lot more.
The script considers you are trading your total equity (eq_BTC ) each time. The fraction of your equity of the volume bar is eq_BTC / vol
Then eq_BTC / vol is the portion or the total fluctuation in price that is due to your entry or exit from the market.
(2 * (high - low) + abs(open - close )) * eq_BTC / vol
is the average change in price due you enter o exit a position.
** the 2 factor accounts for the two directions in the market buying and selling. There is more behind this formula I can explain you in more detail if you like.
I haven't seen anywhere a formula like this one, so it is intended to be a first attempt to get a better approach.
Finally the output of the scripts is how many ticks the price might change due to your trade on each bar
round(slippage/syminfo.mintick)
The script is focused in crypto but it can be used as well on forex markets.
Take care,
@yvponce
S&P Bear Warning IndicatorTHIS SCRIPT HAS BEEN BUILT TO BE USED AS A S&P500 SPY CRASH INDICATOR ON A DAILY TIME FRAME (should not be used as a strategy).
THIS SCRIPT HAS BEEN BUILT AS A STRATEGY FOR VISUALIZATION PURPOSES ONLY AND HAS NOT BEEN OPTIMIZED FOR PROFIT.
The script has been built to show as a lower indicator and also gives visual SELL signal on top when conditions are met. BARE IN MIND NO STOP LOSS, NOR ADVANCED EXIT STRATEGY HAS BEEN BUILT.
As well as the chart SELL signal an alert option has also been built into this script.
The script utilizes a VIX indicator (maroon line) and 50 period Momentum (blue line) and Danger/No trade zone(pink shading).
When the Momentum line crosses down across the VIX this is a sell off but in order to only signal major sell offs the SELL signal only triggers if the momentum continues down through the danger zone.
A SELL signal could be given earlier by removing the need to wait for momentum to continue down through the Danger Zone however this is designed only to catch major market weakness not small sell offs.
As you can see from the picture between the big October 2018 and March 2020 market declines only 2 additional SELLS were triggered.
To use this indicator to identify ideal buying then you should only buy when Momentum line is crossed above the VIX and the Momentum line is above the Danger Zone (ideally 3 - 5 days above danger zone)
Weis Pip Wave jayyWhat you see here is the Weis pip wave. The Weis pip wave shows how far in price a Weis wave has traveled through the duration of a Weis wave. The Weis pip wave is used in combination with the Weis cumulative volume wave. The two waves must be set to the same "wave size" and using the same method as described by Weis.
Using the traditional Weis method simply enter the desired wave size in the box "Select Weis Wave Size". In the example shown, it is set to 5 points. Each wave for each security and each timeframe requires its own wave size. Although not the traditional method a more automatic way to set wave size would be to use ATR. This is not the true Weis method but it does give you similar waves and, importantly, without the hassle of selecting a wave size for every chart. Once the Weis wave size is set then the pip wave will be shown.
I have put a zigzag of a 5 point Weis wave on the above bar chart. I have added it to allow your eye to get a better appreciation for Weis wave pivot points. You will notice that the wave is not in straight lines connecting wave tops to bottoms this is a function of the limitations of Pinescript version 1. This script would need to be in version 4 to allow straight lines. I will elaborate on the Weis pip zigzag script.
What is a Weis wave? David Weis has been recognized as a Wyckoff method analyst he has written two books one of which, Trades About to Happen, describes the evolution of the now popular Weis wave. The method employed by Weis is to identify waves of price action and to compare the strength of the waves on characteristics of wave strength. Chief among the characteristics of strength is the cumulative volume of the wave. There are other markers that Weis uses as well for example how the actual price difference between the start of the Weis wave from start to finish. Weis also uses time, particularly when using a Renko chart. Weis specifically uses candle/bar closes to define all wave action.
David Weis did a futures.io video which is a popular source of information about his method.
Cheers jayy
PS This script was published a day ago, however, I had included some links to the website of a person that uses Weis pip waves and also a dropbox link that contains the Weis wave chart for May 27, 2020, published by David Weis. Providing those links is against TV policy and so the script was hidden by TV. This is the identical script with the identical settings but without the offending links. If you want to see the pip Weis method in practice then search Weis pip wave. I have absolutely no affiliation. If you want to see Weis chart in pdf then message me and I will give a link or the Weis pdf. Why would you want to see the Weis chart for May 27, 2020? Merely to confirm the veracity of my algorithm. You could compare my chart () from the same period to the Weis chart. Both waves are for the ES!1 4 hour chart and both for a wave size of 5.
eha Moving Averages StrategyMoving Average based strategies are very popular ones among both long-term investors and short-term traders as they can be tailored to any time frame. One of the main moving average strategies are crossovers. The very simple type is a price crossover , which is when the price crosses above or below a moving average to signal a potential change in trend.
Another strategy is to apply two moving averages to a chart: one longer (or slow) and one shorter (or fast). When the shorter-term MA crosses above the longer-term MA, it's a buy signal, as it indicates that the trend is shifting up (also known as “ Golden Cross ”). Meanwhile, when the shorter-term MA crosses below the longer-term MA, it's a sell signal, as it indicates that the trend is shifting down (which is also known as “ Dead/Death Cross ”).
This is a study to find a suitable trading strategy for 4-6 hour time frames. As you can see the performance is currently very poor. It has just generated almost 90 trades in a very long period from January 2017 to the time of publishing the study for the first time.
Moving averages work quite well in strong trending conditions but poorly in choppy or ranging conditions. Adjusting the time frame can correct this problem temporarily, although, at some point, these issues are likely to occur regardless of the time frame chosen for the moving average(s).
I am working on this basic strategy to make its performance better and I will update the post in the future. So keep in touch by following the post.
Why have I republished my study?
It sounds like TradingView stores and indexes scripts based on the title of the post rather than the actual title of the scripts and if one chose general terms as the title of the post, the TradingView script search engine may be unable to find it. So I decided to repost the strategy with a more searchable and unique prefix of " eha ".
Please provide me with your precious feedback.
Pivot Point SupertrendHello All,
There are many types of SuperTrend around. Recently I thought about a Supertrend based on Pivot Points then I wrote "Pivot Point SuperTrend" script. It looks it has better performance on keeping you in the trend more.
The idea is behind this script is finding pivot point, calculating average of them and like in supertrend creating higher/lower bands by ATR. As you can see in the algorithm the script gives weigth to past pivot points, this is done for smoothing it a bit.
As I wrote above it may keep you in the trend more, lets see an example:
As an option the script can show main center line and I realized that when you are in a position, this line can be used as early exit points. (maybe half of the position size)
While using Pivot Points, I added support resistance lines by using Pivot Point, as an option the script can show S/R lines:
And also it can show Pivot Points:
When you changed Pivot Point Period you can see its reaction, in following example PP period is 4 (default value is 2). Smaller PP periods more sensitive trendlines.
Alerts added for Buy/Sell entries and Trend Reversals. (when you set alerts use the option " Once Per Bar Close ")
ENJOY!
Linear Regression - Auto Adjust To Ideal Pearson's R (Min & Max)This is meant as a partner to my linear regression strategy script. This one however is just the indicator only so you can overlay the technique over other strategies.
To use this script you need to understand what Pearson's R is; which is how correlated a set of data is to a line within a given deviation (+ or -).
If the Pearson's R is negative (-) then the trend is going upwards. If the value is positive (+) then the trend is going downwards.
There is a lot of debate as to what the ideal negative and positive values are for the Pearson's R, so you can change these in the settings. What the script will do is attempt to automatically find (and draw the trend lines) based on a given minimum period and a maximum period (both set in the settings) that match the ideal Pearson's R settings selected.
Ideally the data is MOST correlated the closest it is to -1 or 1. This means the pattern is very reliable.
This script was designed and works very well with the bar replay mode. You may need a more professional version of TradingView to use this correctly. This mode allows you to see the script in action as it mutates and changes according to the new data being introduced.
I've pre-set the Pearson's R (+) and (-) ranges to what I think is ideal.
TrendLines with AlertsThis isn't my own work, hence giving it in Open Source library for others to benefit from it too.
I have tried to refin the output of trendlines in this Strategy
The original Code is available at
The script needs some modifications, so I'll be making further updates in future, but for now I'm publishing this because most people don't know how to track trandlines, moreover, some use Line.New() by tradingview Pinescript, which again is a bit difficult to deal with.
This script is a basic version of trendlines on a certain angle (anglecheck was provided by the original author in his script).
Nothing fancy in this script.
Also Converted the original Script to Pinescript v4.
Delta Volume Columns [LucF]Displays delta volume columns using intrabar volume information. Each volume column is divided into three sections: buying, selling and neutral volume. Volume for each section is determined from the volume and price movement of each intrabar at a user-selected lower resolution.
Features include:
- Choice of color themes for either dark or light chart backgrounds
- Delta volume columns
- Volume Balance displayed as the difference between the MAs of buying and selling volume
- Display of divergences between a bar’s volume balance and the bar’s price movement (example: buying volume > selling volume but close < open). Divergences can be shown in 2 different color schemes (including green/red showing a tentative direction), on volume columns and/or on chart bars
- Display of bar by bar volume balance with highlighting of above average volume
- Display of the usual total volume MA
- Choice of the lower resolution used to retrieve intrabar information
- Alerts configurable on any combination of the markers, with control over long/short direction
- Choice of 3 different markers:
1. Double bumps: two consecutive bars where buying or selling volume is in the same direction and where volume > volume MA
2. Divergence confirmations: direction of the price bar following a price/volume balance divergence
3. Volume balance shifts: zero level crossings of the volume balance MA delta
The chart shows the two main modes of display:
- Top pane : shows the stacked volume columns with divergences in orange and the flattened volume balance MAs delta at the bottom of the volume columns. This volume balance is the same shown in the bottom pane. The top pane also shows the instant volume balance strip above the volume columns. The strip’s colors show which of the buying or selling volume was greater, and colors are brighter if the total volume was above the total volume MA.
- Bottom pane : shows the volume balance MAs delta with markers 1 and 2. Given that this graphic has no price momentum component, I find quite eerie how it often looks like a momentum-based signal.
The default 5 minute intrabar resolution is used in combination with the weekly chart, which is excessive.
This script uses a special characteristic of the security() function’s behavior when it is sent to a resolution lower than the chart’s resolution. Details are given in the script’s comments. This method has the advantage of working under more circumstances than some of the other loop-based methods, but it also has its limits.
IMPORTANT
This is what you need to know:
- The method used does not work on the realtime bar—only on historical bars. Consequently, the volume column shown on the realtime bar is a normal volume column plotted in green or red, following price movement. The column will only show delta volume information after it closes and becomes a historical bar.
- The indicator only works on some chart resolutions: 5, 10, 15 and 30 minutes, 1, 2, 4, 6, and 12 hours, 1 day, 1 week and 1 month. The script’s code can be modified to run on other resolutions, but chart resolutions must be divisible by the lower resolution used for intrabars.
- Intrabar resolutions can be selected from 1, 5, 15, 30, 45 minutes, 1, 2, 3, 4 hours, 1 day, 1 week and 1 month. The intrabar resolution must of course be smaller than the chart’s resolution.
- Contrary to my other indicators where alerts must be configured to trigger “Once Per Bar Close” in order to avoid false triggers (or repainting), all this indicator’s alerts are designed to trigger using previous bar information since the indicator’s calculations in the realtime bar are not exact. Markers are not plotted with a negative offset; they appear at the beginning of the realtime bar following confirmation of the marker’s condition on the previous bar. Alerts for this indicator should thus be configured to trigger “Once Per Bar” so they trigger at the beginning of the realtime bar. Note that the penalty is not that great, as it is simply the instant between the close of the previous realtime bar and the opening of the next. The advantage of using this technique is that the indicator does not repaint; a marker that appears at the beginning of the realtime bar will never disappear.
- The script only plots information that is reliable in the realtime bar, i.e., total volume and markers. All other plots are set to n/a to prevent misleading traders.
- When the difference between the chart’s resolution and the lower resolution is too important, volume columns will not calculate for all bars in the dataset.
On Delta Volume
Buying or selling volume are misnomers, as every unit of volume transacted is both bought and sold by 2 different traders. There is no such thing as “buy only” or “sell only” volume, but trader lingo is riddled with original fabulations.
Without access to order book information, traders work with the assumption that when price moves up during a bar, there was more buying pressure than selling pressure. The built-in volume indicator available on TradingView uses this logic to color the volume columns green or red. While this script’s numbers are more precise because it analyses a number of intrabars to calculate its information, it uses the exact same imperfect logic to calculate its buying/selling/neutral sections.
Until Pine scripts can have access to how much volume was transacted at the bid/ask prices, our so-called buying/selling volume information will always be a mere proxy.
Divergences
You may wonder how there can be divergences between buying/selling volume information and price movement. This will sometimes be due to the methodology’s shortcomings we have just discussed, but divergences may also occur in instances where because of order book structure, it takes less volume to increase the price of an asset than it takes to decrease it.
As usual, divergences are points of interest because they reveal imbalances, which may or may not become turning points. I do not share the overwhelming enthusiasm traders have for divergences. To your pattern-hungry brain, the orange bars this indicator shows on chart will—as divergences on other indicators do–appear to often indicate turnarounds. My opinion is that reality is generally quite sobering, as many who have tried building automated rules based on divergences will tell you. I do not have hard numbers on the lack of performance of divergences—only many failed attempts to make them perform, which a few experienced strategy modelers I know share with me. Please don’t try to read too much into them. While they look great on past data, I find they are often difficult to use in realtime to make bets with good odds.
Thanks to:
- A guy called Kuan who commented on a Backtest Rookies presentation of an intrabar delta volume indicator using a for loop. The heart of “my” indicator is code borrowed from Kuan; I just built a hopefully useful wrapper around it.
- @theheirophant, my partner in the exploration of the sometimes weird abysses of security() ’s behavior at lower resolutions.
BarstateThe TradingView system has two types of bars. Bars that are historical and bars that are real-time.
When programming complex scripts and strategies that use higher timeframe data there can be difficult programming conditions due to these two bar states.
Especially in the case of after-hours, end of day, low volume trading and thinly traded stocks the bar state status can sometimes be historical and sometimes be real-time in different timeframes or even the same timeframe.
This script displays what state a bar is in by shading the background of the chart.
The script is being made publicly available to help my script users know about and understand 'barstate'. The script allows users to see the 'barstate' in order to help report bugs and conduct their own workarounds.
My testing has indicated that the 'barstate' status is sometimes spurious especially on thinly traded symbols. Additionally, the Tradingview back-end calls the script only after price changes to reduce system load. As a result, these two characteristics can cause unexpected Pine Script results.
Crinkebine
November 2018
MACD Strategy- Script Example how to use % SL in your script ** Tired of Script showing a trade that you stopped out on but is still long on your script? Not any more**
I used Pine script to create realistic trading scenarios for SL users. Now your scripts will reflect what you see on the order book.
a=0.0
a := (*Insert buy condition*)? close: nz(a )
plot(0.98*a, color= green) //2%SL for BUY
b=0.0
b:= (*Insert Short condition*) ? close: nz(b )
plot(1.02*b, color= red) //2% SL for Short
Please check the script on how to implement this :)
vdubongCustom script I fabricated which I use for Binary Trading on the 1m & 3m charts together with Price action & Time management but the principles are the same for all mediums. Use Price action buy/sell in the clear zones. Use the outer 'pink' horizontal lines (highs / lows / pivots points) to place SL's.
I personally run an additional BB 50/2 for clearer BB higher highs & lower low perspective, but it's not part of the script. Script variables are fully customisable.
I don't take ownership of any part of the script, I not a programmer /script writer just a dabbler. Enjoy :) - VDUBONG UPDATED